#include<iostream>
#include<vector>

using namespace std;

int main(){
	int m, n;
	cin>>m>>n;
	vector<vector<int>> grid(m,vector<int>(n));
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++){
			cin>>grid[i][j];
		}
	}
	
	int ret = m * (1 << (n - 1));
    for (int j = 1; j < n; j++) {
        int nOnes = 0;
        for (int i = 0; i < m; i++) {
            if (grid[i][0] == 1) {
                nOnes += grid[i][j];
            } else {
                nOnes += (1 - grid[i][j]);
            }
        }
        int k = max(nOnes, m - nOnes);
        ret += k * (1 << (n - j - 1));
    }

	cout<<ret;
    return 0;
}
